<!--  流量共享  -->

<template>
	<view class="trafficShare">
		<view class="tabs">
			<view class="tabs-item " :class="{'tabs-item-color-active':index==tabsId}" v-for="(item,index) in tabsList"
				:key='index' @click="onTabsChange(index)">
				{{item.name}}
			</view>
		</view>
		<!-- 		<view class="trafficShare_search">
			<view class="u-flex trafficShare_search_box">
			<u-icon name="e752" custom-prefix="iconfont" size="26rpx" color="#999999"></u-icon>
				<input type="text"  class="trafficShare_search_input" placeholder="请输入搜索内容" />
			</view>
			<view class="trafficShare_search_box_btn">
				搜索
			</view>
		</view> -->

		<!-- 推广记录 -->


		<record v-if="tabsId == 1" ref='record' />
		<release v-else ref='release' />
	</view>
</template>

<script>
	import Record from './pane/record.vue'
	import Release from './pane/release.vue'
	export default {
		data() {
			return {
				tabsList: [{
						name: '发布推广',
						id: 0
					},
					{
						name: '推广记录',
						id: 1
					},
				],
				tabsId: 0
			}
		},
		components: {
			Record,
			Release
		},
		onLoad(options) {
			if(this.$refs.release){
				this.$refs.release.initPage()
			}
		},
		onReachBottom() {
		
			if (this.$refs.record) {
				this.$refs.record.$onReachBottom()
			}
		},
		methods: {

			// tabs切换
			onTabsChange(index) {
				this.tabsId = index

				this.$nextTick(function() {
				 this.$refs.record?this.$refs.record.initPage():this.$refs.release.initPage()

						
					
				})
			}
		}
	}
</script>

<style lang='scss' scoped>
	.flex-c-c {
		display: flex;
		align-items: center;
		justify-content: space-between;
	}

	.tabs {
		display: flex;
		justify-content: space-between;
		height: 80rpx;
		box-sizing: border-box;
	}

	.tabs-item {
		flex: 1;
		display: flex;
		align-items: center;
		justify-content: center;
		border-bottom: 1rpx solid #EDEDED;
		box-sizing: border-box;
		font-size: 30rpx;
		color: #222222;
	}

	.tabs-item-color-active {
		width: 100%;
		border-bottom: 4rpx solid #3297EF;
		color: #3297EF;
	}

	.trafficShare_search {
		display: flex;
		justify-content: space-between;
		width: 100%;
		height: 112rpx;
		background: #ffffff;
		padding: 22rpx 31rpx;
		box-sizing: border-box;
	}

	.trafficShare_search_box {
		display: flex;
		align-items: center;
		width: 568rpx;
		background: #EDEDED;
		border-radius: 8rpx;
		padding: 0 20rpx;
		box-sizing: border-box;
	}

	.trafficShare_search_box_btn {
		width: 100rpx;
		height: 68rpx;
		background: #3297EF;
		border-radius: 8rpx;
		color: #ffffff;
		text-align: center;
		line-height: 68rpx;
	}

	.trafficShare_content {
		min-height: calc(100vh - 80rpx - 112rpx);
		background-color: #f5f5f5;
		padding: 20rpx;
		box-sizing: border-box;
	}

	.trafficShare_content_item {
		width: 100%;
		padding: 33rpx 20rpx;
		background-color: #ffffff;
		border-radius: 8rpx;
		margin-bottom: 22rpx;
	}

	.trafficShare_content_item_item {
		position: relative;
	}

	.trafficShare_content_item_item::after {
		content: '';
		position: absolute;
		height: 80%;
		width: 10rpx;
		left: -20rpx;
		top: 0;
		bottom: 0;
		margin: auto 0;
		background-color: #3297EF;
	}

	.trafficShare_content_item_delete {
		font-size: 28rpx;
		color: #FF1515;
		font-weight: 500;
	}


	.t_content-bottom {
		font-size: 26rpx;
		color: #999999;
	}

	.t_content_b_list {
		display: flex;
		justify-content: space-between;
		flex-wrap: wrap;
	}

	.t_content_b_list_img {
		width: calc(100% / 3 - 13.3rpx);
		height: 208rpx;
		margin-bottom: 24rpx;
	}

	.t_content_img {
		width: 100%;
		height: 100%;
		border-radius: 8rpx;
	}

	.t_content_b_list-title {
		display: inline-block;
		width: 150rpx;
		vertical-align: top;
	}

	.t_content_b_list-t-content {
		display: inline-block;
		width: calc(100% - 150rpx);
	}


	.list_message {
		display: flex;
		align-items: center;
		justify-content: center;
		width: 100%;
		min-height: calc(100vh - 80rpx - 112rpx);
	}

	.trafficShare_search_input {
		margin-left: 14rpx;
		width: calc(100% - 14rpx);
		height: 100%;
	}
</style>
